package com.xm.xmapp.adapter;

import java.util.ArrayList;

import android.app.Activity;
import android.view.View;
import android.view.View.OnClickListener;

import com.xm.xmapp.R;
import com.xm.xmapp.base.MyBaseAdapter;
import com.xm.xmapp.base.ViewHolder;
import com.xm.xmapp.customview.CustomLayout;
import com.xm.xmapp.myinterface.ListViewOnclickInterFace;
import com.xm.xmapp.response.bean.ResponseSearchHistory;

public class PoiItemAdapter extends MyBaseAdapter<ResponseSearchHistory> {


	private ListViewOnclickInterFace in;

	public ListViewOnclickInterFace getIn() {
		return in;
	}

	public void setIn(ListViewOnclickInterFace in) {
		this.in = in;
	}

	public PoiItemAdapter(ArrayList<ResponseSearchHistory> list, Activity context,
			int layoutId) {
		super(list, context, layoutId);
		
	}

	@Override
	public void setValues(ViewHolder holder, final ResponseSearchHistory t, int position) {
		
		CustomLayout name = (CustomLayout) holder.getView(R.id.name);
		holder.getView(R.id.city).setVisibility(View.VISIBLE);
		holder.setText(R.id.city, t.provinceName+t.cityName+t.adName);
		name.setText1(t.title);
		name.setImg1Gone();
		name.setImg2Gone();

		holder.getConvertView().setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				

				if(in!=null)
				in.DoSomeThing(t);

			}
		});
	}

}
